export function calculateExamEndTime(startTime: string, durationMinutes: number): string {
  if (!startTime || !durationMinutes) return '';
  const startDate = new Date(startTime);
  const endDate = new Date(startDate.getTime() + durationMinutes * 60 * 1000);
  const year = endDate.getFullYear();
  const month = String(endDate.getMonth() + 1).padStart(2, '0');
  const day = String(endDate.getDate()).padStart(2, '0');
  const hours = String(endDate.getHours()).padStart(2, '0');
  const minutes = String(endDate.getMinutes()).padStart(2, '0');
  const seconds = String(endDate.getSeconds()).padStart(2, '0');
  return `${isNaN(year) ? '' : year}-${isNaN(Number(month)) ? '' : month}-${isNaN(Number(day)) ? '' : day} ${isNaN(Number(hours)) ? '' : hours}:${isNaN(Number(minutes)) ? '' : minutes}:${isNaN(Number(seconds)) ? '' : seconds}`;
}
